home *** CD-ROM | disk | FTP | other *** search
- Path: news.uni-stuttgart.de!schweikh
- From: schweikh@itosun.ito.uni-stuttgart.de (Jens Schweikhardt)
- Newsgroups: comp.lang.c
- Subject: Re: help: gcc
- Date: 11 Mar 1996 14:36:47 GMT
- Organization: Comp.Center (RUS), U of Stuttgart, FRG
- Message-ID: <4i1dpv$4fa8@info4.rus.uni-stuttgart.de>
- References: <4hsk0e$j8f@gail.ripco.com>
- NNTP-Posting-Host: itosun.ito.uni-stuttgart.de
-
- In article <4hsk0e$j8f@gail.ripco.com>,
- Martin Ambuhl <mambuhl@ripco.com> wrote:
- >spiffy@seas.gwu.edu (Marc Goldberg) in
- ><4hpiht$1n2@cronkite.seas.gwu.edu> asks:
- >
- >
- >>2FarmCheck.c: In function `readHostFiles':
- >>2FarmCheck.c:23: dereferencing pointer to incomplete type
- >[etc.]
- >
- >>The lines referred to are:
- >
- >>char *readHostFiles(char *name)
- >> {
- >> int foo;
- >> struct FILE *fileDisc;
- > ^^^^^^
- > Lose this.
- >
- >>(23) *fileDisc = fopen("/users/spiffy/urls.txt", O_RDONLY);
-
- It seems this code was using open() in days of yore and was
- hacked up to use fopen. Or why would anyone write O_RDONLY
- when probably "r" was intended?
-
- Here's what TFM says on Solaris
- NAME
- fopen, freopen, fdopen - open a stream
-
- SYNOPSIS
- #include <stdio.h>
-
- FILE *fopen(const char *filename, const char *type);
-
- FILE *freopen(const char *filename, const char *type,
- FILE *stream);
-
- FILE *fdopen(int fildes, const char *type);
-
- MT-LEVEL
- MT-Safe
-
- DESCRIPTION
- fopen() opens the file named by filename and associates a
- stream with it. fopen() returns a pointer to the FILE
- structure associated with the stream.
-
- filename points to a character string that contains the name
- of the file to be opened.
-
- type is a character string beginning with one of the follow-
- ing sequences:
-
- ``r'' or ``rb'' open for reading
-
- ``w'' or ``wb'' truncate to zero length or
- create for writing
-
- ``a'' or ``ab'' append; open for writing at
- end of file, or create for
- writing
-
- ``r+'', ``r+b'' or ``rb+''
- open for update (reading and
- writing)
-
- ``w+'', ``w+b'' or ``wb+''
- truncate or create for update
-
- ``a+'', ``a+b'' or ``ab+''
- append; open or create for
- update at end-of-file
-
- The ``b'' is ignored in the above types. The ``b'' exists to
- distinguish binary files from text files. However, there is
- no distinction between these types of files on a UNIX sys-
- tem.
- ...
-
- Bye, Jens
- --
- SIGSIG -- signature too long (core dumped)
-